{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "Scanning images:   0%|          | 0/4 [00:00<?, ?it/s]\n",
      "Scanning images: 100%|██████████| 4/4 [00:00<00:00, 313.23it/s]\n",
      "\n",
      "0it [00:00, ?it/s]\n",
      "Scanning labels D:\\code\\program-myself\\ShipYOLO\\datasets\\WSODD\\labels.cache3 (4 found, 0 missing, 0 empty, 0 duplicate, for 4 images): 4it [00:00, ?it/s]\n",
      "\n",
      "Scanning images:   0%|          | 0/2 [00:00<?, ?it/s]\n",
      "Scanning images: 100%|██████████| 2/2 [00:00<?, ?it/s]\n",
      "\n",
      "0it [00:00, ?it/s]\n",
      "Scanning labels D:\\code\\program-myself\\ShipYOLO\\datasets\\WSODD\\labels.cache3 (2 found, 0 missing, 0 empty, 0 duplicate, for 2 images): 2it [00:00, ?it/s]\n",
      "\n",
      "  0%|          | 0/2 [00:00<?, ?it/s]\n",
      "       0/9     1.58G     0.117      2.29    0.1264     2.533         5       512:   0%|          | 0/2 [00:05<?, ?it/s]\n",
      "       0/9     1.58G     0.117      2.29    0.1264     2.533         5       512:  50%|█████     | 1/2 [00:05<00:05,  5.37s/it]\n",
      "       0/9     2.69G    0.1032     2.193    0.1064     2.403        10       512:  50%|█████     | 1/2 [00:05<00:05,  5.37s/it]\n",
      "       0/9     2.69G    0.1032     2.193    0.1064     2.403        10       512: 100%|██████████| 2/2 [00:05<00:00,  2.34s/it]\n",
      "       0/9     2.69G    0.1032     2.193    0.1064     2.403        10       512: 100%|██████████| 2/2 [00:05<00:00,  2.79s/it]\n",
      "\n",
      "  0%|          | 0/2 [00:00<?, ?it/s]\n",
      "       1/9     2.69G    0.1223     1.859    0.1323     2.113         9       512:   0%|          | 0/2 [00:00<?, ?it/s]\n",
      "       1/9     2.69G    0.1223     1.859    0.1323     2.113         9       512:  50%|█████     | 1/2 [00:00<00:00,  2.46it/s]\n",
      "       1/9     2.69G    0.1094     1.743    0.1329     1.985         9       512:  50%|█████     | 1/2 [00:00<00:00,  2.46it/s]\n",
      "       1/9     2.69G    0.1094     1.743    0.1329     1.985         9       512: 100%|██████████| 2/2 [00:00<00:00,  3.54it/s]\n",
      "       1/9     2.69G    0.1094     1.743    0.1329     1.985         9       512: 100%|██████████| 2/2 [00:00<00:00,  3.32it/s]\n",
      "\n",
      "  0%|          | 0/2 [00:00<?, ?it/s]\n",
      "       2/9     2.69G    0.1261     1.411    0.1343     1.671        10       512:   0%|          | 0/2 [00:00<?, ?it/s]\n",
      "       2/9     2.69G    0.1261     1.411    0.1343     1.671        10       512:  50%|█████     | 1/2 [00:00<00:00,  2.41it/s]\n",
      "       2/9     2.69G    0.1235     1.317    0.1297     1.571        10       512:  50%|█████     | 1/2 [00:00<00:00,  2.41it/s]\n",
      "       2/9     2.69G    0.1235     1.317    0.1297     1.571        10       512: 100%|██████████| 2/2 [00:00<00:00,  3.45it/s]\n",
      "       2/9     2.69G    0.1235     1.317    0.1297     1.571        10       512: 100%|██████████| 2/2 [00:00<00:00,  3.24it/s]\n",
      "\n",
      "  0%|          | 0/2 [00:00<?, ?it/s]\n",
      "       3/9     2.69G    0.1291     1.073    0.1329     1.335        10       512:   0%|          | 0/2 [00:00<?, ?it/s]\n",
      "       3/9     2.69G    0.1291     1.073    0.1329     1.335        10       512:  50%|█████     | 1/2 [00:00<00:00,  3.23it/s]\n",
      "       3/9     2.69G    0.1046     1.004    0.1075     1.216         5       512:  50%|█████     | 1/2 [00:00<00:00,  3.23it/s]\n",
      "       3/9     2.69G    0.1046     1.004    0.1075     1.216         5       512: 100%|██████████| 2/2 [00:00<00:00,  4.03it/s]\n",
      "       3/9     2.69G    0.1046     1.004    0.1075     1.216         5       512: 100%|██████████| 2/2 [00:00<00:00,  3.88it/s]\n",
      "\n",
      "               Class      Images     Targets           P           R      mAP@.5  mAP@.5:.95:   0%|          | 0/1 [00:00<?, ?it/s]\n",
      "               Class      Images     Targets           P           R      mAP@.5  mAP@.5:.95:   0%|          | 0/1 [00:02<?, ?it/s]\n",
      "Traceback (most recent call last):\n",
      "  File \"train.py\", line 513, in <module>\n",
      "    train(hyp, opt, device, tb_writer, wandb)\n",
      "  File \"train.py\", line 321, in train\n",
      "    log_imgs=opt.log_imgs if wandb else 0)\n",
      "  File \"d:\\code\\program-myself\\ShipYOLO\\test.py\", line 136, in test\n",
      "    output = non_max_suppression(inf_out, conf_thres=conf_thres, iou_thres=iou_thres)\n",
      "  File \"d:\\code\\program-myself\\ShipYOLO\\utils\\general.py\", line 340, in non_max_suppression\n",
      "    i = torch.ops.torchvision.nms(boxes, scores, iou_thres)\n",
      "RuntimeError: CUDA out of memory. Tried to allocate 3.34 GiB (GPU 0; 6.00 GiB total capacity; 774.85 MiB already allocated; 2.62 GiB free; 1.49 GiB reserved in total by PyTorch)\n"
     ]
    }
   ],
   "source": [
    "!python train.py \\\n",
    "        --data data/wsodd.yaml \\\n",
    "        --epochs 300 \\\n",
    "        --batch-size 2 \\\n",
    "        --img-size 512 \\\n",
    "        --device 0 "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.7.11 ('pytest')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.11"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "bf2e0fd808f5ba0ebe8cde4592c87d322abf68fa23fab81ad59731879a1c713f"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
